[pull] master from cube-js:master#456
Merged
Merged
Conversation
…nsport (-20%) (#10837) Switch the JS->Rust raw query results wire format from row-oriented `Vec<IndexMap<String, DBResponsePrimitive>>` (each row carrying its own copy of every column name) to columnar `JsRawColumnarData { members, columns }`. The pivot is done once on the JS side in `ResultWrapper.serialize` before `JSON.stringify`, then `from_js_raw_data` transposes back to the existing row-major `QueryResult` on Rust without per-cell clones. Also drops the `JsArray` + `JsValueDeserializer` ingest path in `orchestrator.rs` — only `JsBox<Arc<QueryResult>>` and `JsBuffer` are accepted now. The `JsValueDeserializer` walk was the slow path the buffer route was already winning against. Bench: synthetic dataset, 60% string dims / 40% f64 measures, no nulls, `cargo bench --bench transform -- --sample-size 30 --measurement-time 3`. Rust ingest path (`serde_json::from_slice` + `from_js_raw_data`, median): | Dataset | rows (master) | columnar (this) | Faster by | Speedup | | ------------------- | ------------: | --------------: | --------: | ------: | | 8 cols x 10k rows | 52.4 ms | 40.8 ms | -22 % | 1.29 x | | 16 cols x 10k rows | 107.2 ms | 82.9 ms | -23 % | 1.29 x | | 16 cols x 100k rows | 1024.7 ms | 827.7 ms | -19 % | 1.24 x | | 32 cols x 100k rows | 2019.8 ms | 1633.9 ms | -19 % | 1.24 x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )